﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CUiC3DGeneratorSettingsForm
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using EngineeringInternalExtension;
using System;
using System.ComponentModel;
using System.Windows.Forms;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands;

internal class CUiC3DGeneratorSettingsForm : TxForm
{
  private CApC3DDocumentationSettings m_documentationSettings = new CApC3DDocumentationSettings();
  private IContainer components;
  private GroupBox m_groupBoxIncludedParts;
  private RadioButton m_radioButtonAllParts;
  private RadioButton m_radioButtonOnlyIncludedInSnapshots;
  private RadioButton m_radioButtonOnlyDisplayed;
  private CheckBox m_checkBoxSimulation;
  private CheckBox m_checkBoxIncludePmis;
  private Button m_buttonCancel;
  private Button m_buttonOK;
  private GroupBox m_groupBoxIncludedData;
  private GroupBox m_groupBoxLevelOfDetails;
  private RadioButton m_radioButtonLow;
  private RadioButton m_radioButtonMedium;
  private RadioButton m_radioButtonHigh;
  private GroupBox m_groupBoxIncludedSnapshots;
  private RadioButton m_radioButtonAllSnapshots;
  private RadioButton m_radioButtonOnlyAssignedSnap;

  public CUiC3DGeneratorSettingsForm() => this.InitializeComponent();

  public CApC3DDocumentationSettings DocumentationSettings
  {
    get => this.m_documentationSettings;
    set => this.m_documentationSettings = value;
  }

  private void CUiC3DGeneratorSettingsForm_Load(object sender, EventArgs e) => this.LoadSettings();

  private void LoadSettings()
  {
    this.m_checkBoxIncludePmis.Checked = this.m_documentationSettings.IncludePMIs;
    this.m_checkBoxSimulation.Checked = this.m_documentationSettings.RecordAnimation;
    this.m_radioButtonAllSnapshots.Checked = this.m_documentationSettings.StoreAllSnapshots;
    this.m_radioButtonOnlyAssignedSnap.Checked = !this.m_radioButtonAllSnapshots.Checked;
    switch (this.m_documentationSettings.IncludedObjectsMode)
    {
      case CApC3DDocumentationSettings.CApC3DIncludedObjectsMode.OnlyDisplayedObjectsInScene:
        this.m_radioButtonOnlyDisplayed.Checked = true;
        break;
      case CApC3DDocumentationSettings.CApC3DIncludedObjectsMode.OnlyObjectsIncludedInSnapshotsAndSimulation:
        this.m_radioButtonOnlyIncludedInSnapshots.Checked = true;
        break;
      case CApC3DDocumentationSettings.CApC3DIncludedObjectsMode.AllLoadedObjects:
        this.m_radioButtonAllParts.Checked = true;
        break;
      default:
        this.m_radioButtonAllParts.Checked = true;
        break;
    }
    if (this.m_documentationSettings.LevelOfDetails == 0)
      this.m_radioButtonHigh.Checked = true;
    else if (this.m_documentationSettings.LevelOfDetails == 1)
    {
      this.m_radioButtonMedium.Checked = true;
    }
    else
    {
      if (this.m_documentationSettings.LevelOfDetails != 2)
        return;
      this.m_radioButtonLow.Checked = true;
    }
  }

  private void StoreSettings()
  {
    this.m_documentationSettings.IncludePMIs = this.m_checkBoxIncludePmis.Checked;
    this.m_documentationSettings.RecordAnimation = this.m_checkBoxSimulation.Checked;
    this.m_documentationSettings.StoreAllSnapshots = this.m_radioButtonAllSnapshots.Checked;
    if (this.m_radioButtonAllParts.Checked)
      this.m_documentationSettings.IncludedObjectsMode = CApC3DDocumentationSettings.CApC3DIncludedObjectsMode.AllLoadedObjects;
    else if (this.m_radioButtonOnlyDisplayed.Checked)
      this.m_documentationSettings.IncludedObjectsMode = CApC3DDocumentationSettings.CApC3DIncludedObjectsMode.OnlyDisplayedObjectsInScene;
    else if (this.m_radioButtonOnlyIncludedInSnapshots.Checked)
      this.m_documentationSettings.IncludedObjectsMode = CApC3DDocumentationSettings.CApC3DIncludedObjectsMode.OnlyObjectsIncludedInSnapshotsAndSimulation;
    this.m_documentationSettings.PdfMode = (TxExportGraphicsAnimationFileFormatEx) 1;
    if (this.m_radioButtonHigh.Checked)
      this.m_documentationSettings.LevelOfDetails = 0;
    else if (this.m_radioButtonMedium.Checked)
    {
      this.m_documentationSettings.LevelOfDetails = 1;
    }
    else
    {
      if (!this.m_radioButtonLow.Checked)
        return;
      this.m_documentationSettings.LevelOfDetails = 2;
    }
  }

  private void m_buttonOK_Click(object sender, EventArgs e) => this.StoreSettings();

  protected virtual void Dispose(bool disposing)
  {
    if (disposing && this.components != null)
      this.components.Dispose();
    base.Dispose(disposing);
  }

  private void InitializeComponent()
  {
    ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (CUiC3DGeneratorSettingsForm));
    this.m_checkBoxIncludePmis = new CheckBox();
    this.m_checkBoxSimulation = new CheckBox();
    this.m_groupBoxIncludedParts = new GroupBox();
    this.m_radioButtonAllParts = new RadioButton();
    this.m_radioButtonOnlyIncludedInSnapshots = new RadioButton();
    this.m_radioButtonOnlyDisplayed = new RadioButton();
    this.m_buttonCancel = new Button();
    this.m_buttonOK = new Button();
    this.m_groupBoxIncludedData = new GroupBox();
    this.m_groupBoxLevelOfDetails = new GroupBox();
    this.m_radioButtonLow = new RadioButton();
    this.m_radioButtonMedium = new RadioButton();
    this.m_radioButtonHigh = new RadioButton();
    this.m_groupBoxIncludedSnapshots = new GroupBox();
    this.m_radioButtonAllSnapshots = new RadioButton();
    this.m_radioButtonOnlyAssignedSnap = new RadioButton();
    this.m_groupBoxIncludedParts.SuspendLayout();
    this.m_groupBoxIncludedData.SuspendLayout();
    this.m_groupBoxLevelOfDetails.SuspendLayout();
    this.m_groupBoxIncludedSnapshots.SuspendLayout();
    ((Control) this).SuspendLayout();
    componentResourceManager.ApplyResources((object) this.m_checkBoxIncludePmis, "m_checkBoxIncludePmis");
    this.m_checkBoxIncludePmis.Name = "m_checkBoxIncludePmis";
    this.m_checkBoxIncludePmis.UseVisualStyleBackColor = true;
    componentResourceManager.ApplyResources((object) this.m_checkBoxSimulation, "m_checkBoxSimulation");
    this.m_checkBoxSimulation.Name = "m_checkBoxSimulation";
    this.m_checkBoxSimulation.UseVisualStyleBackColor = true;
    this.m_groupBoxIncludedParts.Controls.Add((Control) this.m_radioButtonAllParts);
    this.m_groupBoxIncludedParts.Controls.Add((Control) this.m_radioButtonOnlyIncludedInSnapshots);
    this.m_groupBoxIncludedParts.Controls.Add((Control) this.m_radioButtonOnlyDisplayed);
    componentResourceManager.ApplyResources((object) this.m_groupBoxIncludedParts, "m_groupBoxIncludedParts");
    this.m_groupBoxIncludedParts.Name = "m_groupBoxIncludedParts";
    this.m_groupBoxIncludedParts.TabStop = false;
    componentResourceManager.ApplyResources((object) this.m_radioButtonAllParts, "m_radioButtonAllParts");
    this.m_radioButtonAllParts.Name = "m_radioButtonAllParts";
    this.m_radioButtonAllParts.UseVisualStyleBackColor = true;
    componentResourceManager.ApplyResources((object) this.m_radioButtonOnlyIncludedInSnapshots, "m_radioButtonOnlyIncludedInSnapshots");
    this.m_radioButtonOnlyIncludedInSnapshots.Name = "m_radioButtonOnlyIncludedInSnapshots";
    this.m_radioButtonOnlyIncludedInSnapshots.UseVisualStyleBackColor = true;
    componentResourceManager.ApplyResources((object) this.m_radioButtonOnlyDisplayed, "m_radioButtonOnlyDisplayed");
    this.m_radioButtonOnlyDisplayed.Checked = true;
    this.m_radioButtonOnlyDisplayed.Name = "m_radioButtonOnlyDisplayed";
    this.m_radioButtonOnlyDisplayed.TabStop = true;
    this.m_radioButtonOnlyDisplayed.UseVisualStyleBackColor = true;
    this.m_buttonCancel.DialogResult = DialogResult.Cancel;
    componentResourceManager.ApplyResources((object) this.m_buttonCancel, "m_buttonCancel");
    this.m_buttonCancel.Name = "m_buttonCancel";
    this.m_buttonCancel.UseVisualStyleBackColor = true;
    this.m_buttonOK.DialogResult = DialogResult.OK;
    componentResourceManager.ApplyResources((object) this.m_buttonOK, "m_buttonOK");
    this.m_buttonOK.Name = "m_buttonOK";
    this.m_buttonOK.UseVisualStyleBackColor = true;
    this.m_buttonOK.Click += new EventHandler(this.m_buttonOK_Click);
    this.m_groupBoxIncludedData.Controls.Add((Control) this.m_checkBoxIncludePmis);
    this.m_groupBoxIncludedData.Controls.Add((Control) this.m_checkBoxSimulation);
    componentResourceManager.ApplyResources((object) this.m_groupBoxIncludedData, "m_groupBoxIncludedData");
    this.m_groupBoxIncludedData.Name = "m_groupBoxIncludedData";
    this.m_groupBoxIncludedData.TabStop = false;
    this.m_groupBoxLevelOfDetails.Controls.Add((Control) this.m_radioButtonLow);
    this.m_groupBoxLevelOfDetails.Controls.Add((Control) this.m_radioButtonMedium);
    this.m_groupBoxLevelOfDetails.Controls.Add((Control) this.m_radioButtonHigh);
    componentResourceManager.ApplyResources((object) this.m_groupBoxLevelOfDetails, "m_groupBoxLevelOfDetails");
    this.m_groupBoxLevelOfDetails.Name = "m_groupBoxLevelOfDetails";
    this.m_groupBoxLevelOfDetails.TabStop = false;
    componentResourceManager.ApplyResources((object) this.m_radioButtonLow, "m_radioButtonLow");
    this.m_radioButtonLow.Name = "m_radioButtonLow";
    this.m_radioButtonLow.UseVisualStyleBackColor = true;
    componentResourceManager.ApplyResources((object) this.m_radioButtonMedium, "m_radioButtonMedium");
    this.m_radioButtonMedium.Name = "m_radioButtonMedium";
    this.m_radioButtonMedium.UseVisualStyleBackColor = true;
    componentResourceManager.ApplyResources((object) this.m_radioButtonHigh, "m_radioButtonHigh");
    this.m_radioButtonHigh.Checked = true;
    this.m_radioButtonHigh.Name = "m_radioButtonHigh";
    this.m_radioButtonHigh.TabStop = true;
    this.m_radioButtonHigh.UseVisualStyleBackColor = true;
    this.m_groupBoxIncludedSnapshots.Controls.Add((Control) this.m_radioButtonAllSnapshots);
    this.m_groupBoxIncludedSnapshots.Controls.Add((Control) this.m_radioButtonOnlyAssignedSnap);
    componentResourceManager.ApplyResources((object) this.m_groupBoxIncludedSnapshots, "m_groupBoxIncludedSnapshots");
    this.m_groupBoxIncludedSnapshots.Name = "m_groupBoxIncludedSnapshots";
    this.m_groupBoxIncludedSnapshots.TabStop = false;
    componentResourceManager.ApplyResources((object) this.m_radioButtonAllSnapshots, "m_radioButtonAllSnapshots");
    this.m_radioButtonAllSnapshots.Name = "m_radioButtonAllSnapshots";
    this.m_radioButtonAllSnapshots.UseVisualStyleBackColor = true;
    componentResourceManager.ApplyResources((object) this.m_radioButtonOnlyAssignedSnap, "m_radioButtonOnlyAssignedSnap");
    this.m_radioButtonOnlyAssignedSnap.Checked = true;
    this.m_radioButtonOnlyAssignedSnap.Name = "m_radioButtonOnlyAssignedSnap";
    this.m_radioButtonOnlyAssignedSnap.TabStop = true;
    this.m_radioButtonOnlyAssignedSnap.UseVisualStyleBackColor = true;
    ((Form) this).AcceptButton = (IButtonControl) this.m_buttonOK;
    componentResourceManager.ApplyResources((object) this, "$this");
    ((ContainerControl) this).AutoScaleMode = AutoScaleMode.Font;
    ((Form) this).CancelButton = (IButtonControl) this.m_buttonCancel;
    ((Control) this).Controls.Add((Control) this.m_groupBoxIncludedSnapshots);
    ((Control) this).Controls.Add((Control) this.m_groupBoxLevelOfDetails);
    ((Control) this).Controls.Add((Control) this.m_groupBoxIncludedData);
    ((Control) this).Controls.Add((Control) this.m_buttonOK);
    ((Control) this).Controls.Add((Control) this.m_buttonCancel);
    ((Control) this).Controls.Add((Control) this.m_groupBoxIncludedParts);
    ((Form) this).FormBorderStyle = FormBorderStyle.FixedDialog;
    ((Form) this).MaximizeBox = false;
    ((Form) this).MinimizeBox = false;
    ((Control) this).Name = nameof (CUiC3DGeneratorSettingsForm);
    ((Form) this).ShowIcon = false;
    ((Form) this).Load += new EventHandler(this.CUiC3DGeneratorSettingsForm_Load);
    this.m_groupBoxIncludedParts.ResumeLayout(false);
    this.m_groupBoxIncludedParts.PerformLayout();
    this.m_groupBoxIncludedData.ResumeLayout(false);
    this.m_groupBoxIncludedData.PerformLayout();
    this.m_groupBoxLevelOfDetails.ResumeLayout(false);
    this.m_groupBoxLevelOfDetails.PerformLayout();
    this.m_groupBoxIncludedSnapshots.ResumeLayout(false);
    this.m_groupBoxIncludedSnapshots.PerformLayout();
    ((Control) this).ResumeLayout(false);
  }
}
